<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>

		<div class="width">
			<h:form id="menubarForm">
				<p:menubar>
					<p:submenu label="Purchase Requisition"
						rendered="#{not empty userSession.projectId}" 
						icon="ui-icon-document">
						<p:menuitem value="Create" outcome="/pr/create" />
						<p:menuitem value="Open Items" outcome="/pr/list_open" ajax="false"/>
						<p:menuitem value="For Approval" outcome="/pr/list_approval" />
						<p:menuitem value="Approved" outcome="/pr/list_approved" />
						<p:menuitem value="Archived" outcome="/pr/list_archived" />
					</p:submenu>
					<p:submenu label="Purchase Order" icon="ui-icon-calculator"
						rendered="#{(not empty userSession.projectId and (userSession.purchaser or userSession.manager)) or userSession.admin}">
						<p:menuitem value="Outstanding PR" action="/po/outstanding"
							icon="ui-icon-plus" />
						<p:menuitem value="Create" action="/po/main" icon="ui-icon-plus" />
						<p:menuitem value="List" action="/po/list" icon="ui-icon-script" />
					</p:submenu>
					<p:submenu label="Inventory" icon="ui-icon-note">
						<p:submenu label="Item Transactions" icon="ui-icon-refresh">
							<p:menuitem value="Receivables" action="/inv/receivables"
								icon="ui-icon-arrow-1-se" />
							<p:menuitem value="For Withdrawals" action="/inv/withdrawals"
								icon="ui-icon-arrow-1-nw" />
							<p:menuitem value="For Pickup" action="/inv/pickups"
								icon="ui-icon-pin-w" />
							<p:menuitem value="Closed" action="/inv/archives"
								icon="ui-icon-power" />
						</p:submenu>
						<p:submenu label="Returns" icon="ui-icon-transferthick-e-w">
							<p:menuitem value="Add" action="/ret/add" icon="ui-icon-plus" />
							<p:menuitem value="Withdraw" action="/ret/withdraw"
								icon="ui-icon-minus" />
						</p:submenu>
						<p:submenu label="Audits" icon="ui-icon-search">
							<p:menuitem value="Inventory Flow" action="/inv/flows"
								icon="ui-icon-transfer-e-w" />
						</p:submenu>
					</p:submenu>
					<p:submenu label="Admin" icon="ui-icon-gear"
						rendered="#{userSession.admin}">
						<p:submenu label="Users">
							<p:menuitem value="Create" action="/admin/users" />
							<p:menuitem value="Groups" action="/admin/groups" />
						</p:submenu>
						<p:menuitem value="Projects" action="/admin/projects" />
						<p:menuitem value="Master List" action="/ml/main" />
					</p:submenu>

					<ui:remove>

						<p:menuitem value="Admin" action="/admin/main" />
					</ui:remove>
					<f:facet name="options">
						<h:commandButton action="#{userSession.logout}" value="Logout" />
					</f:facet>
				</p:menubar>
			</h:form>

		</div>

		<div class="clear"></div>
	</ui:composition>
</body>
</html>